<template>
    <div>
        <!--详情弹出框 -->
        <el-dialog title='详情' :visible.sync='detailVisible' width='50%' >
            <el-form ref='addForm' :model='detailForm' label-width='100px' style='height: 300px'>


                <el-form-item label='标题：' prop='emailTopic' >
                    <el-input v-model='detailForm.emailTopic' type='text' :disabled='true'></el-input>
                </el-form-item>

                <el-form-item label='文本域：' prop='emailContent' >
                    <el-input type='textarea' v-model='detailForm.emailContent'   :disabled='true' :rows='6'></el-input>
                </el-form-item>
                <el-form-item label='附件：'>
                    <a
                        v-for='item in fileList'
                        :href='item.url'
                        style='margin-right: 20px'
                    >
                        {{item.name}}
                    </a>
                </el-form-item>
            </el-form>

        </el-dialog>

    </div>
</template>

<script>
export default {
    name: 'detailEmail',
    data() {
        return {
            //是否展示
            detailVisible: false,
            fileList: [],
            detailForm: {
                emailTopic: '',//标题
                emailContent: '',//信件内容
                fileVos: []//附件
            },
            receiveManList: []//收件人下拉框
        };
    },
    methods: {
        //初始化表单
        init(param) {
            //初始化清除表单验证
            this.detailForm = {},
                //初始化收件人下拉框
                this.$http.post('/basicserver/noticeController/checkTheNotice.json', param).then(res => {
                    if (res.data.status) {
                        console.log(res.data.data);
                        this.detailForm = res.data.data;
                        this.fileList = res.data.data.fileVos;
                        this.detailVisible = true;
                        //调用父组件，刷新页面
                        this.$emit('get-data', null);
                    }
                });
        }
    }
};
</script>

<style scoped>
.upload-demo {
    /*margin-left: 100px;*/
}
</style>
